// strngbad.h -- flawed string class definition
#include <iostream>
#ifndef STRNGBAD_H_
#define STRNGBAD_H_
class StringBad
{
private:
    char *str; // pointer to string
    // 这里使用的char*指针存储相关的字符串数据(注意是指针)
    int len;                // length of string
    static int num_strings; // number of objects
public:
    StringBad(const char *s); // constructor
    StringBad();              // default constructor
    ~StringBad();             // destructor
                              // friend function
    friend std::ostream &operator<<(std::ostream &os,
                                    const StringBad &st);
    StringBad(const StringBad &st);
    StringBad & operator=(const StringBad & st);
};
#endif
